﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using System.Net;
using System.Xml;
using System.IO;
using System.Web;
using GoGrid;

namespace Readify.Management.Automation.GoGrid
{
    [Cmdlet("Delete", "GoGridLoadBalancer")]
    public class DeleteGoGridLoadBalancerCmdlet : GoGridCmdletBase
    {
        [Parameter(Mandatory = true)]
        public string Name { get; set; }

        protected override void ProcessRecord()
        {
            Connection connection = this.GetConnection();

            LoadBalancer balancer = connection.DeleteLoadBalancer(
                FindLoadBalancer.ByName(this.Name)
                );

            this.WriteObject(balancer);
        }
    }
}
